package com.dongjiantong.common.exceptions;

/**
 * Created by cao on 2017/10/27.
 */
public class OPServerException extends OPException{
    public OPServerException() {
        this(500, "系统发生异常");
    }

    public OPServerException(String reason) {
        super(500, reason);
    }

    public OPServerException(int code, String reason) {
        super(code, reason);
    }

    public OPServerException(int code, String reason, Object... args) {
        super(code, reason, args);
    }

    /**
     * 建议使用枚举
     * @param code
     */
    public OPServerException(HttpCode code) {
        super(code.getCode(), code.getMessage());
    }

    /**
     *
     * 自定义错误
     * @param code
     * @param reason
     */
    public OPServerException(HttpCode code,String reason) {
        super(code.getCode(), reason);
    }
}
